package leecode

func firstMissingPositive(nums []int) int {
	hashMap := make(map[int]bool)
	for i := 0; i < len(nums); i++ {
		hashMap[nums[i]] = true
	}
	index := 1
	result := 0
	for result == 0 {
		if !hashMap[index] {
			result = index
		}
		index++
	}
	return result
}
